﻿<%@ Page Language="C#" MasterPageFile="../../MasterPage.Master" AutoEventWireup="true" CodeBehind="ICM_Requisition_Approve.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Form.ICM_Requisition_Approve" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="server">
     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
          <script type="text/javascript" src="../../Scripts/Common.js"></script>
          <script type="text/javascript">
              function DetailRequisition(requisition_code)
              {
                   radopen("../Edit_Form/ICM_Requisition_Approve.aspx"+ "?Requsition_Code="+requisition_code ,"WindowDetail");
              }
              function closeRadWindow(sender, args) 
              {
                   $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();
              }
          </script>
     </telerik:RadCodeBlock>
     <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="grdInventory">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="grdInventory" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="PanelCombo" LoadingPanelID = "RadAjaxLoadingPanel1" />
                            </UpdatedControls>  
                        </telerik:AjaxSetting>
                       <%-- <telerik:AjaxSetting AjaxControlID="cmbStatusRequest">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="grdInventory" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="cmbStatusRequest" LoadingPanelID = "RadAjaxLoadingPanel1" />
                            </UpdatedControls>  
                        </telerik:AjaxSetting>--%>
                        <telerik:AjaxSetting AjaxControlID="Panel2">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="Panel2" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="PanelCombo" LoadingPanelID = "RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="Panel1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="Panel2" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="PanelCombo" LoadingPanelID = "RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                         <%--<telerik:AjaxSetting AjaxControlID="PanelCombo">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="grdInventory" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="PanelCombo" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        --%>
                    </AjaxSettings>    
    </telerik:RadAjaxManager>
    <%--<div class="moduleContent1000">
           <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel2" runat="server" CssClass="contentPaneDiv" Height="30px" ScrollBars="Auto" >
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                        <td colspan="220px">
                                                    &nbsp;
                                        </td>
                                        <td>
                                                    <asp:LinkButton ID="btnSave" runat="server" CssClass="LinkButton"  onclick="btnSave_Click">
                                                        <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cmd_Save.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                                    </asp:LinkButton>
                                        </td>
                               </tr> 
                            </table>
                 </asp:Panel>
           </div>
    </div>--%>                          
    <div class="moduleContent1000">
                                  <div class="moduleDivBottom1000">
                                     <asp:Panel ID="Panel1" runat="server" CssClass="contentPaneDiv" Height="400px" ScrollBars="Auto" align = "center" >    
                                               <table>
                                                     <tr>
                                                              <td>
                                                                         <div class="header-grid" align="align">
                                                                                   <asp:Label ID="lblHeaderList" runat="server" Text="รายละเอียดใบขอเบิกของที่รอให้ทำการอนุมัติ" ></asp:Label>
                                                                         </div>
                                                              </td>
                                                     </tr>
                                                     <tr>
                                                              <td>
                                                                     <asp:Panel runat ="server" ID="PanelCombo">
                                                                                <table>
                                                                                       <tr>
                                                                                              <td>
                                                                                                         <asp:Label ID="lblStatusRequest" runat = "server" Text ="กรองสถานะของใบขอเบิกของ" />
                                                                                              </td>
                                                                                              <td>
                                                                                                         <telerik:RadComboBox ID="cmbStatusRequest" Runat="server"  AutoPostBack="true" OnSelectedIndexChanged="cmbStatusRequest_OnSelectedIndexChanged">
                                                                                                         </telerik:RadComboBox>
                                                                                              </td>
                                                                                       </tr>
                                                                                </table>
                                                                      </asp:Panel>  
                                                              </td>
                                                     </tr>
                                                     <tr>
                                                              <td>
                                                                         <telerik:RadGrid ID="grdRequisition" runat="server" AutoGenerateColumns="false"
                                                                                    AllowMultiRowEdit="false" AllowMultiRowSelection="true" ShowStatusBar="true"
                                                                                    Width="922px" Height="288px" AllowPaging="true" AllowFilteringByColumn="true"
                                                                                    GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                                                    GroupingSettings-GroupContinuedFormatString=""
                                                                                    GroupingSettings-GroupContinuesFormatString=""
                                                                                    GroupingSettings-GroupSplitFormat="" PageSize ="7"
                                                                                    OnNeedDataSource="grdRequisition_NeedDataSource"
                                                                                    OnItemCommand="grdRequisition_ItemCommand" align ="left">
                                                                                    <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client"
                                                                                        DataKeyNames="requisition_code" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                                                                                        <RowIndicatorColumn>
                                                                                            <HeaderStyle Width="20px" />
                                                                                        </RowIndicatorColumn>
                                                                                        <ExpandCollapseColumn>
                                                                                            <HeaderStyle Width="20px" />
                                                                                        </ExpandCollapseColumn>
                                                                                        <Columns>  
                                                                                           <%-- <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="25px">
                                                                                                    <HeaderStyle Width="25px" />
                                                                                            </telerik:GridClientSelectColumn> --%> 
                                                                                            <%--<telerik:GridTemplateColumn AllowFiltering="false" UniqueName="return" HeaderText="ตีกลับ" HeaderStyle-Width="35px" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"> 
                                                                                                <FilterTemplate></FilterTemplate>
                                                                                                <ItemTemplate>
                                                                                                    &nbsp;&nbsp;&nbsp;
                                                                                                         <asp:ImageButton ID="cmdDelete" runat="server" CommandName="DataDelete"
                                                                                                            ImageUrl="~/App_UI/Image/Grid/Delete.gif" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')"
                                                                                                            ToolTip="ตีกลับ" width="17" /> 
                                                                                                </ItemTemplate>
                                                                                            </telerik:GridTemplateColumn>--%>
                                                                                            <telerik:GridBoundColumn DataField="requisition_date" DataFormatString="{0:d}"
                                                                                                HeaderText="วันที่ขอเบิก" UniqueName="requisition_date"
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="100px"
                                                                                                HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridTemplateColumn DataField="requisition_code" HeaderText="เลขที่ขอเบิกของ" ShowFilterIcon="false" HeaderStyle-Font-Bold="true"
                                                                                                    HeaderStyle-Width="130px" HeaderStyle-HorizontalAlign="Center" FilterControlWidth="100%" UniqueName="requisition_code">
                                                                                                    <ItemTemplate >                                                                                                                           
                                                                                                            <asp:LinkButton ID="targetControl" runat="server" Text='<%# Eval("requisition_code") %>' 
                                                                                                            OnClientClick='<%# string.Format("return DetailRequisition(\"{0}\");", Eval("requisition_code")) %>'  > 
                                                                                                            </asp:LinkButton><%--OnClientClick='<%# string.Format("return openReceiveEdit(\"{0}\",\"{1}\");", Eval("trans_mas_seq"),"Edit") %>'--%>
                                                                                                    </ItemTemplate>
                                                                                            </telerik:GridTemplateColumn>
                                                                                            <telerik:GridTemplateColumn DataField="description" HeaderText="รายการเบิกของ" ShowFilterIcon="false" HeaderStyle-Font-Bold="true"
                                                                                                    HeaderStyle-HorizontalAlign="Center" FilterControlWidth="100%" UniqueName="description">
                                                                                                    <ItemTemplate >                                                                                                                           
                                                                                                            <asp:LinkButton ID="description" runat="server" Text='<%# Eval("description") %>' 
                                                                                                            OnClientClick='<%# string.Format("return DetailRequisition(\"{0}\");", Eval("requisition_code")) %>'  > 
                                                                                                            </asp:LinkButton>
                                                                                                    </ItemTemplate>
                                                                                            </telerik:GridTemplateColumn>
                                                                                            <telerik:GridBoundColumn DataField="icm_obj_type_name" 
                                                                                                HeaderText="ประเภทวัสดุ" UniqueName="icm_obj_type_name" HeaderStyle-Width="100px"
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true" AllowFiltering = "true"
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                                HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="employee_name" 
                                                                                                HeaderText="ผู้ขอเบิก" UniqueName="employee_name"
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true" AllowFiltering = "true"
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="140px"
                                                                                                HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="status_name" 
                                                                                                HeaderText="สถานะการเบิก" UniqueName="status_name"
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="70px" 
                                                                                                HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <%--<telerik:GridTemplateColumn AllowFiltering="false" UniqueName="Delete" HeaderText="ตีกลับ" HeaderStyle-Width="35px" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"> 
                                                                                                <FilterTemplate></FilterTemplate>
                                                                                                <ItemTemplate>
                                                                                                         &nbsp;&nbsp;&nbsp;
                                                                                                         <asp:ImageButton ID="btnReturn" runat="server" CommandName="DataReturn"
                                                                                                            ImageUrl="~/App_UI/Image/Grid/Delete.gif" OnClientClick="javascript:return confirm('ยืนยันการตีกลับใบที่ขอเบิกของที่เลือก')"
                                                                                                            ToolTip="ตีกลับรายการ" width="17" /> 
                                                                                                </ItemTemplate>
                                                                                            </telerik:GridTemplateColumn>--%>
                                                                                        </Columns>
                                                                                        <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                                                                                            FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                                                                            NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                                                                            PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                                                                                        </MasterTableView>
                                                                            <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                                                                                GroupContinuedFormatString="" GroupContinuesFormatString="" 
                                                                                GroupSplitFormat="" />
                                                                            <ClientSettings EnableRowHoverStyle="True">
                                                                                <Selecting AllowRowSelect="true" />
                                                                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                                                            </ClientSettings>
                                                                        </telerik:RadGrid> 
                                                              </td>
                                                     </tr>
                                               </table>   
                                     </asp:Panel>
                                  </div>   
    </div> 
    
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" >
    <Windows>
        <telerik:RadWindow ID="WindowDetail" runat="server" Width="1020px" Height="545px"
            showcontentduringload="false"  VisibleStatusbar="false"
            Modal="true" Skin = "Vista" behaviors="Close"
            title="แสดงรายละเอียดใบขอเบิกของ" 
            OnClientClose="closeRadWindow" >
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>                              
</asp:Content>          